﻿

if not Exists(select * from sysobjects where name = 'NewsLetterCampaign' and Xtype = 'U') 
Begin

	Create table dbo.NewsLetterCampaign (
		Id int identity(1,1) not null,
		Name varchar(255) not null,
		ReplyToEmail varchar(50) not null,
		ReplyToEmailName varchar(100) null,
		Description varchar(max) null,
		CreationDate datetime null,
		Version timestamp not null,
		NewsLetterId int ,
		OwnerId int,
		StateId int,
		PublicKey varchar(50) null,
		AdditionalUrlParameters varchar(1024),
		EmailListSourceId int,
		SMTPServerId int
	)

	alter table dbo.NewsLetterCampaign add constraint PK_NewsLetterCampaign_Id primary key (Id)

	DBCC CHECKIDENT (NewsLetterCampaign, RESEED, 1000)
End